/**
 * 24C02 02(表示2K-bit)= 256Byte
 * Address: 0x00~0xFF
 * I2C-EEPROM
 */
#ifndef __AT24C02_H
#define __AT24C02_H

#include "SimulateI2C.h"

// WP 写保护 高电平有效
// 24c02 器件地址
// 1010  A2 A1 A0 (W/R)
// 1010   0  0  0   0
#define AT24C02_ADDRESS 0xA0

#define AT24C02_PAGE_SIZE 16

uint8_t AT24C02_ReadByte(uint8_t ReadAddr);

void AT24C02_ReadBuffer(uint8_t ReadAddr, uint8_t *pBuf, uint16_t len);

void AT24C02_WriteByte(uint8_t WriteAddr, uint8_t by);

void AT24C02_WritePage(uint8_t WriteAddr, uint8_t *pBuf, uint16_t len);

#endif
